/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gradiente;

import java.awt.Point;
import java.io.Serializable;

/**
 *
 * @author uhgy3k
 */
public class Ant implements Serializable{
    int MaxCarry=3;
    int id;
    int type;
    int vel;
    int atk;
    int def;
    int food;
    Point place;
    int hp;
    
    Ant(int iden, int tipo, int a, int b) {        
        place = new Point();
        /* tipos:
         * 0 - Guerrera
         * 1 - Exploradora
         * 2 - Trabajadora
         */
        place.x = a;
        place.y = b;
        id=iden;
        switch(tipo) {
            case 0:
                type=0;
                vel=1;
                atk=2;
                def=1;
                hp=4;
                break;
            case 1:
                type=1;
                vel=3;
                atk=1;
                def=0;
                hp=3;
                break;
            case 2:
                type=2;
                vel=2;
                atk=1;
                def=1;
                hp=6;
                food=0;
                break;
        }
        
    }
    void move(int dir){
        switch(dir){
            case 0:
                place.x--;
                place.y--;
                break;
            case 1:
                place.x--;
                break;
            case 2:
                place.x--;
                place.y++;
                break;
            case 3:
                place.y--;
                break;
            case 4:
                
                break;
            case 5:
                place.y++;
                break;
            case 6:
                place.x++;
                place.y--;
                break;
            case 7:
                place.x++;
                break;
            case 8:
                place.x++;
                place.y++;
                break;
    }
    }
    void take(int AFood){
        int cargo=0;
        if(MaxCarry>AFood){
         cargo=AFood;   
         AFood=0;
        }else{
            cargo=MaxCarry;
            AFood-=MaxCarry;
        }
        Ant.this.food+=cargo;
    }
    void attack(){
        
    }
    void score(){
        
    }
    int comida_cargada(){
        return food;
    }
}
